package com.ssm.server.user.controller;

import com.ssm.server.common.JsonData;
import com.ssm.server.user.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @author zhangyibo
 */
@RestController
public class UserController {
    @Autowired
    private UserService userService;
    
    

    /*
     *获取用户信息
     */
    @RequestMapping("/user/getUserById")
    public JsonData getUserById(@RequestParam Map<String, String> param) throws Exception {
        return userService.getUserById(param);
    } 
    
    /*
     *赏袋
     */
    @RequestMapping("/user/getPrizeBag")
    public JsonData getPrizeBag(@RequestParam Map<String, String> param) throws Exception {
        return userService.getPrizeBag(param);
    } 
    
    /*
     *消费记录
     */
    @RequestMapping("/user/getOrderByUser")
    public JsonData getOrderByUser(@RequestParam Map<String, String> param) throws Exception {
        return userService.getOrderByUser(param);
    } 
    
    /*
     *获奖记录
     */
    @RequestMapping("/user/getPrizeLog")
    public JsonData getPrizeLog(@RequestParam Map<String, String> param) throws Exception {
        return userService.getPrizeLog(param);
    }
    /*
     *查看赏票
     */
    @RequestMapping("/user/getPrizeTicketByUser")
    public JsonData getPrizeTicketByUser(@RequestParam Map<String, String> param) throws Exception {
        return userService.getPrizeTicketByUser(param);
    }
    /*
     *充值余额类型
     */
    @RequestMapping("/user/getVoucherCenter")
    public JsonData getVoucherCenter(@RequestParam Map<String, String> param) throws Exception {
        return userService.getVoucherCenter(param);
    }
    

    /*
     *微信抽奖
     */
    
    @RequestMapping("/user/buyBox")
    public JsonData buyBox(@RequestParam Map<String, String> param) throws Exception {
        return userService.buyBox(param);
    }
    
    /*
     *余额抽奖
     */
    @RequestMapping("/user/moneybuyBox")
    public JsonData moneybuyBox(@RequestParam Map<String, String> param) throws Exception {
        return userService.moneybuyBox(param);
    }
    
    
    
    /**
	 * 微信支付成功回調
	 */
	@RequestMapping("/security/paySuccess")
	public JsonData paySuccess(@RequestParam Map<String, String> param) throws Exception  {
		return userService.payCallBackHandle(param);
	}
	
	
	   /**
		 * 微信支付成功回調
		 */
		@RequestMapping("/security/PayMoney")
		public JsonData PayMoney(@RequestParam Map<String, String> param) throws Exception  {
			return userService.PayMoney(param);
		}
	
	
	
	
	
	 /**
		 * 充值余额成功回調
		 */
		@RequestMapping("/security/payMoneySuccess")
		public JsonData payMoneySuccess(@RequestParam Map<String, String> param) throws Exception  {
			return userService.payCallBackHandleisPayMoney(param);
		}
    /*
     *撕开赏票
     */
    @RequestMapping("/user/updateaUserPrizeCoin")
    public JsonData updateaUserPrizeCoin(@RequestParam Map<String, String> param) throws Exception {
        return userService.updateaUserPrizeCoin(param);
    }
    
    /*
     *微信登录
     */
    @RequestMapping("/security/userWeixinLogin")
    public JsonData getJscode2session(@RequestParam Map<String, String> param) throws Exception {
        return userService.getJscode2session(param);
    }
    
    
    /*
     *微信授权手机号
     */
    @RequestMapping("/user/getPersonalInformation")
    public JsonData getPersonalInformation(@RequestParam Map<String, String> param) throws Exception {
        return userService.getPersonalInformation(param);
    }
    
    /*
     *授权用户信息
     */
    @RequestMapping("/user/updateUserInfo")
    public JsonData updateUserInfo(@RequestParam Map<String, String> param) throws Exception {
        return userService.updateUserInfo(param);
    }
    
    /*
     *获取图文信息
     */
    @RequestMapping("/sysMessage/getSysMessage")
    public JsonData getSysMessage(@RequestParam Map<String, String> param) throws Exception {
        return userService.getSysMessage(param);
    }
    
    /*
     *获取当前用户剩余赏币
     */
    @RequestMapping("/user/getPrizeCoin")
    public JsonData getPrizeCoin(@RequestParam Map<String, String> param) throws Exception {
        return userService.getPrizeCoin(param);
    }
    
    /*
     *返回抽奖信息
     */
    @RequestMapping("/user/returnPrizeBox")
    public JsonData returnPrizeBox(@RequestParam Map<String, String> param) throws Exception {
        return userService.returnPrizeBox(param);
    }
    
    /*
	 *获取通知
	 * 
	 */
	@RequestMapping("/sysMessage/getSysNews")
	public JsonData getSysNews(@RequestParam Map<String, String> param) throws Exception {
		return userService.getSysNews(param);
	}
	
	
	  /*
		 *统计未读通知
		 * 
		 */
		@RequestMapping("/sysMessage/countUnreadNews")
		public JsonData countUnreadNews(@RequestParam Map<String, String> param) throws Exception {
			return userService.countUnreadNews(param);
		}
	  
	  /*
	 *赏币消费记录
	 * 
	 */
	@RequestMapping("/user/getPrizeCoinLog")
	public JsonData getPrizeCoinLog(@RequestParam Map<String, String> param) throws Exception {
		return userService.getPrizeCoinLog(param);
	}

	  /*
		 *赏币获奖记录
		 * 
		 */
		@RequestMapping("/user/getUserCoin")
		public JsonData getUserCoin(@RequestParam Map<String, String> param) throws Exception {
			return userService.getUserCoin(param);
		}
		  /*
		 *赏币消费记录
		 * 
		 */
		@RequestMapping("/weixin/tuikuan")
		public JsonData tuikuan(@RequestParam Map<String, String> param) throws Exception {
			return userService.tuikuan(param);
		}
	
	
	
}
